package com.treasure.mall.zbq.common.ienum.auth;

/**
 * @author allan
 * @date 2018-01-05
 */
public interface IAuthority {
    enum MenuRole {
        ALL, MANAGER, STATION_AGENT
    }

    enum Menu {
        //服务项目
        PRODUCT_CENTER("10000", "服务项目", null, 0, null, "&#xe631;", MenuRole.MANAGER),
        PRODUCT_MANAGER("11000", "项目列表", PRODUCT_CENTER, 1, "/product/list", MenuRole.MANAGER),
        PRODUCT_ADD("12000", "添加项目", PRODUCT_CENTER, 1, "/product/edit", MenuRole.MANAGER),
        SKILL_MANAGER("13000", "技能管理", PRODUCT_CENTER, 1, "/skill/list", MenuRole.MANAGER),

        //问诊订单
        ORDER_MANAGER("20000", "订单管理", null, 0, null, "&#xe632;"),
        ORDER_LIST("21000", "订单列表", ORDER_MANAGER, 1, "/order/list"),
//        TREATMENT_LIST("22000", "疗程管理", ORDER_MANAGER, 1, "/order/treatment/list"),

        //医护人员
        MEDICAL_STAFF_MANAGER("30000", "医护管理", null, 0, null, "&#xe632;"),
        MEDICAL_STAFF_LIST("31000", "医护列表", MEDICAL_STAFF_MANAGER, 1, "/medicalStaff/list"),
        MEDICAL_STAFF_ADD("32000", "添加医护", MEDICAL_STAFF_MANAGER, 1, "/medicalStaff/edit"),
        POINT_MANAGER("33000", "网点管理", MEDICAL_STAFF_MANAGER, 1, "/point/list", MenuRole.MANAGER),
        POINT_MANAGER_BY_AGENT("34000", "网点管理", MEDICAL_STAFF_MANAGER, 1, "/point/pointList", MenuRole.STATION_AGENT),
        MEDICAL_STAFF_TYPE("35000", "医护类型", MEDICAL_STAFF_MANAGER, 1, "/staffType/list", MenuRole.MANAGER),

        //病人资料
        PATIENT_MANAGER("40000", "病人管理", null, 0, null, "&#xe632;"),
        PATIENT_LIST("41000", "病人列表", PATIENT_MANAGER, 1, "/patient/list"),

        //财务管理
        FINANCE_MANAGER("60000", "财务管理", null, 0, null, "&#xe632;"),
        RECEIPT_CHECK("61000", "收款单审核", FINANCE_MANAGER, 1, "/receipt/list"),
        ACCOUNTS_MANAGER("62000", "收款账户", FINANCE_MANAGER, 1, "/receiptAccount/list"),

        //设置
        CONFIG("50000", "全站设置", null, 0, null, "&#xe675;", MenuRole.MANAGER),
        AUTH_MANAGER("51000", "权限管理", CONFIG, 1, null, MenuRole.MANAGER),
        MANAGER("51100", "管理员管理", AUTH_MANAGER, 2, "/manager/list", MenuRole.MANAGER),
        ROLE("51200", "角色管理", AUTH_MANAGER, 2, "/managerRole/list", MenuRole.MANAGER);

        private String code;
        private String name;
        private Menu parent;
        private int index;
        private String uri;
        private String icon;
        /**
         * 0:全部
         * 1:管理员
         * 2:站长
         */
        private MenuRole role;

        Menu(String code, String name, Menu parent, int index, String uri, String icon, MenuRole role) {
            this.code = code;
            this.name = name;
            this.parent = parent;
            this.index = index;
            this.uri = uri;
            this.icon = icon;
            this.role = role;
        }

        Menu(String code, String name, Menu parent, int index, String uri, String icon) {
            this.code = code;
            this.name = name;
            this.parent = parent;
            this.index = index;
            this.uri = uri;
            this.icon = icon;
            this.role = MenuRole.ALL;
        }

        Menu(String code, String name, Menu parent, int index, String uri, MenuRole role) {
            this.code = code;
            this.name = name;
            this.parent = parent;
            this.index = index;
            this.uri = uri;
            this.role = role;
        }

        Menu(String code, String name, Menu parent, int index, String uri) {
            this.code = code;
            this.name = name;
            this.parent = parent;
            this.index = index;
            this.uri = uri;
            this.role = MenuRole.ALL;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Menu getParent() {
            return parent;
        }

        public void setParent(Menu parent) {
            this.parent = parent;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public String getUri() {
            return uri;
        }

        public void setUri(String uri) {
            this.uri = uri;
        }

        public String getIcon() {
            return icon;
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }

        public MenuRole getRole() {
            return role;
        }

        public void setRole(MenuRole role) {
            this.role = role;
        }
    }

    enum Function {
        ;

        private String code;
        private String name;
        private Menu menu;

        Function(String code, String name, Menu menu) {
            this.code = code;
            this.name = name;
            this.menu = menu;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Menu getMenu() {
            return menu;
        }

        public void setMenu(Menu menu) {
            this.menu = menu;
        }
    }
}
